package eightDataType;

/**
 * TODO Boolean.parseBoolean("abc") =false;default value !!!!
 * 结论
 * 异或的运算法则为：0⊕0=0，1⊕0=1，0⊕1=1，1⊕1=0（同为0，异为1）. 布尔类型：(true^false) > true
 */
public class BooleanDemo {
    public static void main(String[] args) {

        //异或的运算法则为：0⊕0=0，1⊕0=1，0⊕1=1，1⊕1=0（同为0，异为1）. 布尔类型：(true^false) > true
        //(true^true) > false
        //(false^false) > false
        //(true^false) > true
        System.out.println("BooleanDemo:main:"+(true^true));// > false
        System.out.println("BooleanDemo:main:"+(false^false));// > false
        System.out.println("BooleanDemo:main:"+(true^false));// > true


        boolData boolData = new boolData();
        System.out.println("bwrap " + boolData.getbWrap());
        System.out.println("b " + boolData.isB());
        System.out.println("bwrap --> b " + boolData.isB());
//	System.out.println("bwrap --> b "+boolData.getWrapToNull());

        boolean aTrue1 = Boolean.parseBoolean("True");
        boolean aTrue2 = Boolean.parseBoolean("true");
        boolean aTrue3 = Boolean.parseBoolean("TRUE");

        System.out.println(aTrue1 + " " + aTrue2 + " " + aTrue3);


        try {

            boolean abc = Boolean.parseBoolean("abc");
            System.out.println("parse " + abc);
        } catch (Exception e) {
            System.out.println("Exception abc");
            e.printStackTrace();
        }

    }
}

class boolData {
    private Boolean bWrap;
    private boolean b;

    public Boolean getbWrap() {
        return bWrap;
    }

    public void setbWrap(Boolean bWrap) {
        this.bWrap = bWrap;
    }

    public boolean isB() {
        return b;
    }

    public void setB(boolean b) {
        this.b = b;
    }

    public boolean getWrapToNull() {
        return bWrap;
    }


}